/*
 * @Author: your name
 * @Date: 2021-11-22 16:02:33
 * @LastEditTime: 2022-02-24 16:49:12
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \agricultural-production-web\src\api\agricultural-work-management\agricultural-work-classification\index.js
 */
/*
 * @Description: 农事作业
 */
// import zhreq from "@/api/axios-threeline";
import axios from "@/api/axios";
// import { List } from "echarts";
// import twoline from "@/api/axios-twoline";
let farmingTypeNo = sessionStorage.getItem("farmingTypeNo")
export default {
  /**
   * @description: 获取所有农事作业表格列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   */
  getWorkTypeList(params) {
    params.entity['farmingTypeNo'] = farmingTypeNo
    params.entity['organization'] = sessionStorage.organization;
    let zhenpar = { ...params }
    return axios.post("/v3/agriculturalTask/agriculturalWorkType/queryPageByCondition", zhenpar);
  },
  getqueryAllList() {
    let zhenpar = {
      "farmingTypeNo": farmingTypeNo
    }
    return axios.post("/v3/agriculturalTask/agriculturalWorkType/queryByCondition", zhenpar);
  },
  // 111111111111
  queryInputsByNoList(no) {
    return axios.get("v3/agriculturalTask/agriculturalTask/queryInputsByNo?no=" + no);
  },
  getqueryMethodList() {
    return axios.get("agriculturalTask/queryMethod");
  },
  queryWorkTypeList(id) {
    return axios.get(`/v3/agriculturalTask/agriculturalWorkType/queryByNo?no=${id}`);
  },
  // 获取农事作业
  queryEquipmentList() {
    let zhenpar = {
      "organizationList": sessionStorage.organizationList
    }
    return axios.post(`equipment/queryByCondition`, zhenpar);
  },
  // 查询承租户
  querylessesList(e) {
    let zhenpar = {
      "organizationList": sessionStorage.organizationList,
      contactStatus: e
    }
    return axios.post(`lessee/queryByCondition`, zhenpar);
  },
  /**
   * @description: 添加农事作业数据
   * @param {Object}  *
   */
  addmeslist(params) {
    let zhenpar = {
      ...params,
      "farmingTypeNo": sessionStorage.farmingTypeNo,
      "organizationNo": sessionStorage.organizationNo
    }
    return axios.post('/v3/agriculturalTask/agriculturalWorkType/add', zhenpar);
  },
  /**
  * @description: 修改农事作业数据
  * @param {Object}  *
  */
  editmeslist(params) {
    let zhenpar = {
      ...params,
      "farmingTypeNo": sessionStorage.farmingTypeNo
    }
    return axios.post('/v3/agriculturalTask/agriculturalWorkType/edit', zhenpar);
  },
  /**
  * @description: 删除农事作业数据
  * @param {Object}  *
  */
  delmeslist(list) {
    return axios.post('/v3/agriculturalTask/agriculturalWorkType/delListByNo', {
      noList: list
    });
  }
};

